var teachers = [
    {
        id: 1,
        // checkbox: '<input type="checkbox">',
        name: '小张',
        section: '教师',
        sex: '男',
        teach: '博士学位',
        tel: 1010150,
        email: 'info@example.com',
        entry:  '2018-08-12',
        standing: '20年',
        photo: '../../images/xzh_images/01.jpeg'
        // operation: '查看 编辑'
    },
    {
        id: 2,
        // checkbox: '<input type="checkbox">',
        name: '小李',
        section: '教师',
        sex: '男',
        teach: '博士学位',
        tel: 1548646,
        email: 'info@example.com',
        entry:  '2017-04-02',
        standing: '21年',
        photo: '../../images/xzh_images/02.jpeg'
        // operation: '查看 编辑'
    },
    {
        id: 3,
        // checkbox: '<input type="checkbox">',
        name: '小王',
        section: '教师',
        sex: '女',
        teach: '硕士学位',
        tel: 1008611,
        email: 'info@example.com',
        entry:  '2015-05-28',
        standing: '23年',
        photo: '../../images/xzh_images/01.jpeg'
        // operation: '查看 编辑'
    },
    {
        id: 4,
        // checkbox: '<input type="checkbox">',
        name: '小刘',
        section: '教师',
        sex: '女',
        teach: '研究生',
        tel: 5214556,
        email: 'info@example.com',
        entry:  '2022-11-14',
        standing: '15年',
        photo: '../../images/xzh_images/02.jpeg'
        // operation: '查看 编辑'
    }
];

//新增
function addTeacher(teacherName,teacherTel,teacherBumen,teacherGongling,teacherEa,teacherSex,teacherJiaoyu,demoTest) {

    var teachs = {
        id: Date.now(),
        name: teacherName,
        section: teacherBumen,
        sex: teacherSex,
        teach: teacherJiaoyu,
        tel: teacherTel,
        email: teacherEa,
        entry: demoTest,
        standing: teacherGongling
        // photo: teacherPhoto
    };

    teachers.unshift(teachs);

    localStorage.setItem('teachers',JSON.stringify(teachers));
}

function getTeacher() {
    var localTeacher = JSON.parse(localStorage.getItem('teachers'));

    return localTeacher || teachers;
}

